﻿using System;

class Program
{
    static void Main(string[] args)
    {
        // 示例数组
        int[] numbers = {1,4,2,5,7,3,6,8};

        // 计算最大值
        int max = numbers[0];
        for (int i = 1; i < numbers.Length; i++)
        {
            if (numbers[i] > max)
            {
                max = numbers[i];
            }
        }

        // 计算最小值
        int min = numbers[0];
        for (int i = 1; i < numbers.Length; i++)
        {
            if (numbers[i] < min)
            {
                min = numbers[i];
            }
        }

        // 计算总和
        int sum = 0;
        for (int i = 0; i < numbers.Length; i++)
        {
            sum += numbers[i];
        }

        // 计算平均值
        double average = (double)sum / numbers.Length;

        // 输出结果
        Console.WriteLine("数组: [{0}]", string.Join(", ", numbers));
        Console.WriteLine("最大值: {0}", max);
        Console.WriteLine("最小值: {0}", min);
        Console.WriteLine("总和: {0}", sum);
        Console.WriteLine("平均值: {0:F2}", average);
    }
}